#!"/Applications/XAMPP/xamppfiles/bin/perl"

package Supplement;

sub new
{
    my $class = shift;
    my $self = {
        _id => shift,
        _type => shift,
        _name => shift,
        _pricePerUnit => shift,
        _unitType => shift,
        _quantity => undef
    };
    bless $self, $class;
    return $self;
}

sub getType {
    my( $self ) = @_;
    return $self->{_type};
}

sub getName {
    my( $self ) = @_;
    return $self->{_name};
}

sub getPPU {
    my( $self ) = @_;
    return $self->{_pricePerUnit};
}

sub getUnitType {
    my( $self ) = @_;
    return $self->{_unitType};
}

sub setQuantity
{
	my ( $self, $qiantity ) = @_;
    $self->{_quantity} = $quantity if defined($quantity);
    return $self->{_quantity};
}

sub getQuantity
{
	my ($self) = @_;
	return $self->{_quantity}? $self->{_quantity}:0;
}

sub setId
{
	my ( $self, $id ) = @_;
    $self->{_id} = $id if defined($id);
    return $self->{_id};
}

sub getId
{
	my ($self) = @_;
	return $self->{_id}? $self->{_id}:-1;
}

1;